home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1999
/
MacHack 1999.toast
/
The Hacks
/
DesktopDoubler
/
NubApp
/
Menu.h
< prev
next >
Wrap
Text File
|
1999-06-23
|
3KB
|
120 lines
#ifndef _MENU_
#define _MENU_
#include <Menus.h>
#include "LList.h"
#include "Window.h"
enum
{
kDisabled = (1L << 0)
};
typedef class Menu
{
public:
MenuHandle fMenu;
UInt32 fFlags;
virtual void DoUpdate(void) = 0;
virtual void DoSelect(UInt32 item) = 0;
virtual Boolean DoSetDisableState(Boolean isBeingDisabled) = 0;
virtual void DoWindowNotice(Window *window,Boolean isBeingAdded) = 0;
virtual void DoWindowActivation(Window *window,Boolean isBeingActivated) = 0;
} Menu;
typedef class MenuManager
{
public:
virtual void DoAddMenu(Menu *menu) = 0;
virtual void DoMenuUpdates(void) = 0;
virtual void DoSelect(UInt32 menu,UInt32 item) = 0;
virtual void DoWindowNotice(Window *window,Boolean isBeingAdded) = 0;
virtual void DoWindowActivation(Window *window,Boolean isBeingActivated) = 0;
virtual Menu *DoGetMenu(UInt32 menuID) = 0;
} MenuManager;
typedef struct BaseMenuObject
{
BaseMenuObject *next;
UInt32 fMenuID;
Menu *fMenuObject;
} BaseMenuObject;
typedef class BaseMenuManager : public MenuManager
{
public:
LList<BaseMenuObject> fMenuList;
virtual void DoAddMenu(Menu *menu);
virtual void DoMenuUpdates(void);
virtual void DoSelect(UInt32 menu,UInt32 item);
virtual void DoWindowNotice(Window *window,Boolean isBeingAdded);
virtual void DoWindowActivation(Window *window,Boolean isBeingActivated);
virtual Menu *DoGetMenu(UInt32 menuID);
virtual void HandleAddMenu(Menu *menu);
virtual void HandleMenuUpdate(Menu *menu);
virtual void HandleSelect(Menu *menu,UInt32 item);
virtual void HandleWindowNotice(Menu *menu,Window *window,Boolean isBeingAdded);
virtual void HandleWindowActivation(Menu *menu,Window *window,Boolean isBeingActivated);
virtual Menu *HandleGetMenu(UInt32 menuID);
} BaseMenuManager;
typedef class BaseMenu : public Menu
{
public:
BaseMenu(UInt32 menuID);
virtual void DoUpdate(void);
virtual void DoSelect(UInt32 item);
virtual Boolean DoSetDisableState(Boolean isBeingDisabled);
virtual void DoWindowNotice(Window *window,Boolean isBeingAdded);
virtual void DoWindowActivation(Window *window,Boolean isBeingActivated);
virtual void HandleUpdate(void);
virtual void HandleSelect(UInt32 item);
virtual void HandleSetDisableState(Boolean isBeingDisabled);
virtual void HandleWindowNotice(Window *window,Boolean isBeingAdded);
virtual void HandleWindowActivation(Window *window,Boolean isBeingActivated);
} BaseMenu;
typedef class AppleMenu : public BaseMenu
{
public:
AppleMenu(void);
virtual void HandleSelect(UInt32 item);
virtual void HandleSetDisableState(Boolean isBeingDisabled);
void ShowAboutBox(void);
} AppleMenu;
typedef class FileMenu : public BaseMenu
{
public:
FileMenu(void);
virtual void HandleSelect(UInt32 item);
} FileMenu;
typedef class EditMenu : public BaseMenu
{
public:
EditMenu(void);
virtual void HandleSelect(UInt32 item);
} EditMenu;
#endif /* _MENU_ */